<template>
	<view class="box-agreement">
		<view style="text-align: center;">请认真阅读理解以下协议</view>
		<view class="box-flex-center">
			<radio :checked="selected" @click="change"></radio>同意
			<navigator url="" open-type="redirect" hover-class="none" style="color: #2979ff;">《隐私政策》</navigator>和
			<navigator url="" open-type="redirect" hover-class="none" style="color: #2979ff;">《用户协议》</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		name: "cuAgreement",
		props: {
			checked: {
				type: Boolean,
				default: false
			}
		},
		watch: {
			checked: {
				handler(val) {
					this.selected = val;
				},
				immediate: true,
				deep: true
			}
		},
		data() {
			return {
				selected: false
			};
		},
		methods: {
			change() {
				this.selected = !this.selected;
				this.$emit('change', this.selected);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box-agreement {
		position: absolute;
		bottom: 30px;
		left: 20vw;
	}
</style>
